package cn.ac.cintcm.synonymous;

import java.util.List;

public class PagedWords implements PagedData {
    
    private String[][] data;
    
    public PagedWords(List<Word> words) {
        if (words != null) {
            data = new String[words.size() + 1][2];
            String[] str = null;
            int i = 0;
            for (Word w : words) {
                str = new String[2];
                str[0] = w.getName();
                str[1] = w.isAlias()?Config.INFORMAL:Config.FORMAL;
                data[++i] = str;
            }
        }
    }

    public String[][] getData() {
        
        return data;
    }

    public int getLength() {
        return data==null?0:(data.length -1);
    }

}
